file(GLOB_RECURSE SRCS_C ${CMAKE_CURRENT_LIST_DIR}/*.c)
file(GLOB_RECURSE SRCS_S ${CMAKE_CURRENT_LIST_DIR}/*.S)
file(GLOB_RECURSE SRCS_A ${CMAKE_CURRENT_LIST_DIR}/../common/*.c)
file(GLOB_RECURSE SRCS_B ${CMAKE_CURRENT_LIST_DIR}/../common/*.S)

list(APPEND SRCS ${SRCS_C} ${SRCS_S} ${SRCS_A} ${SRCS_B})


set(ARCH_LD ${CMAKE_CURRENT_LIST_DIR}/link.lds CACHE INTERNAL "pass to top")

## some linker script ends with suffix .lds.s
##
## One important thing should be noticed is that
## cmake on windows is not case-sensitive.
## remove linker script from source file Explicitly
list(REMOVE_ITEM SRCS ${ARCH_LD})